package com.lytis.zoovideo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author :DongPeiLei
 * @description :
 * @create :2022-06-04 22:08:00
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        String path = "F:\\大三\\项目实践课\\zooLivingDesign\\zooVideo\\src\\main\\resources\\static\\jpg\\";
        String jpeg = "F:\\大三\\项目实践课\\zooLivingDesign\\zooVideo\\src\\main\\resources\\static\\jpeg\\";
        String png = "F:\\大三\\项目实践课\\zooLivingDesign\\zooVideo\\src\\main\\resources\\static\\png\\";
        //uploadFile对应resource下工程目录
        registry.addResourceHandler("/jpg/**").addResourceLocations("file:" + path);
        registry.addResourceHandler("/jpeg/**").addResourceLocations("file:" + jpeg);
        registry.addResourceHandler("/png/**").addResourceLocations("file:" + png);
    }
}
